package com.unione.unione_network

import com.unione.unione_network.constant.NetModelConstant
import okhttp3.Interceptor
import okhttp3.Response

class CommonInterceptor : Interceptor {

    override fun intercept(chain: Interceptor.Chain): Response {
               val builder = chain.request().newBuilder()
        builder.addHeader("Source", "source")
        builder.addHeader("Authorization", NetModelConstant.token)
        // zh_CN、en_US
        // zh_CN、en_US
        if (NetModelConstant.langEng) {
            builder.addHeader("content-language", "en_US")
        } else {
            builder.addHeader("content-language", "zh_CN")
        }
        return chain.proceed(builder.build())
    }
}